# for item in items
# 打印元祖
import random

xm = {
    'name': 'xm',
    'sex': 'female',
    'address': '湖南省-张家界市-桑植县',
    'birthday': '2000-04-14'
}
for key in xm.keys():
    print(xm.get(key), end="")

print("打印文件", end='/n')
fi = open('Demo01.py', mode='r+', encoding='utf-8')
for item in fi:
    print(item + "\t", end="")

print("打印数组", end='\n')
nums = [1, 2, 3, 4, 5, 7, 8, 6, 4, 7, 5, 4, 7, 5]
for num in nums:
    print(num.__str__() + "\t", end="")

print("99乘法表(for实现)", end="\n")
for num1 in range(1, 10):
    for num2 in range(1, num1 + 1):
        n1 = num1.__str__()
        n2 = num2.__str__()
        result = (num1 * num2).__str__()
        print(n1 + "*" + n2 + "=" + result + "\t", end='')
    print("", end='\n')

print("99乘法表(while实现)", end="\n")
n1 = 9
n2 = 1
while (n1 > 0):
    while (n2 <= n1):
        print(n1.__str__() + "*" + n2.__str__() + "=" + (n1 * n2).__str__() + "\t", end='')
        n2 += 1
    n1 -= 1
    n2 = 1
    print(end="\n")

# print("数的累加:", end="\n")
# num = input("请输入一个你想要累加的数字：\t\n")
# result1 = 0
# for temp in range(int(num) + 1):
#     result1 += temp
# print(result1)

print('字符串减1', end="\n")
str = "Hello World,I Am Your Master"
while str != '':
    for str1 in str:
        print(str1, end="")
    print(end="\t\n")
    str = str[:-1]

print("random语法", end='\t\n')
random.seed(1)
print(random.random())
print(random.random())
random.seed(10)
print(random.random())
